//
//  CETransformBottomCell.m
//  digitalCurrency
//
//  Created by 来迎宾 on 2019/4/9.
//  Copyright © 2019年 XinHuoKeJi. All rights reserved.
//

#import "CETransformBottomCell.h"

@interface CETransformBottomCell ()

@end


@implementation CETransformBottomCell

+ (instancetype)createTableView:(UITableView *)tableView {
    CETransformBottomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"bottomcell"];
    cell.selectionStyle   = UITableViewCellSelectionStyleNone;
    cell.backgroundColor  = [UIColor blackColor];
    
    [cell makeViews];
    
    return cell;
}


- (void)makeViews {
    
    [self.contentView addSubview:self.textField];
    [self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(22);
        make.top.mas_equalTo(5);
        make.right.mas_equalTo(-22);
        make.height.mas_equalTo(41);
    }];
    
    CGFloat viewwidth = SCREEN_WIDTH-30;
    
    UILabel *canuserdLabel = [[UILabel alloc] init];
    [self.contentView addSubview:canuserdLabel];
    self.canuserdLabel = canuserdLabel;
    canuserdLabel.text = [NSString stringWithFormat:@"%@ 0",LocalizationKey(@"Available balance")];
    canuserdLabel.font = [UIFont systemFontOfSize:13];
    canuserdLabel.textColor = [UIColor whiteColor];
    
    [canuserdLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(55);
        make.width.mas_equalTo(viewwidth/2.0);
        make.height.mas_equalTo(18);
        make.left.mas_equalTo(22);
    }];
    
    UILabel *feeLabel = [[UILabel alloc] init];
    feeLabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:feeLabel];
    self.feeLabel = feeLabel;
    feeLabel.text = [NSString stringWithFormat:@"%@:0",LocalizationKey(@"Transfer charge")];
    feeLabel.font = [UIFont systemFontOfSize:13];
    feeLabel.textColor = [UIColor whiteColor];
    
    [feeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(55);
        make.width.mas_equalTo(viewwidth/2.0);
        make.height.mas_equalTo(15);
        make.right.mas_equalTo(-22);
    }];
    
    [self.contentView addSubview:self.nextbtn];
    [self.nextbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(90);
        make.left.mas_equalTo(23);
        make.height.mas_equalTo(44);
        make.right.mas_equalTo(-23);
    }];
    
}


- (UITextField *)textField {
    if (!_textField) {
        _textField = [[UITextField alloc] init];
        _textField.textColor = [UIColor whiteColor];
        _textField.font = [UIFont systemFontOfSize:14];
        _textField.borderStyle = UITextBorderStyleRoundedRect;
        _textField.clearButtonMode = UITextFieldViewModeWhileEditing;
        _textField.placeholder = LocalizationKey(@"Please enter withdrawal quantity");
        
        _textField.layer.cornerRadius = 5;
        _textField.layer.borderColor  = [UIColor colorWithHEX:@"AAAAAA"].CGColor;
        _textField.layer.borderWidth  = 1;
        
        _textField.backgroundColor = [UIColor clearColor];
//        [_textField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
    }
    
    return _textField;
}
    
- (UIButton *)nextbtn {
    if (!_nextbtn) {
        _nextbtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _nextbtn.layer.cornerRadius = 4;
        [_nextbtn setTitle:LocalizationKey(@"Confirm") forState:UIControlStateNormal];
        [_nextbtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _nextbtn.backgroundColor = [UIColor colorWithHEX:maincolor];
        
        _nextbtn.titleLabel.font = [UIFont systemFontOfSize:18];
    }
    
    return _nextbtn;
}
    
@end
